<template>
	<view class="">
		<view class="solids-bottom padding-xs flex align-center bg-white">
				<view class="flex-sub">
					<text style="font-size: 30rpx;font-weight: bold;">提现金额</text>
					<view class="" style="display: flex;">
						<text style="font-size: 65rpx;font-weight: bold;">￥</text>
						<input type="digit" v-model="money" confirm-type="send" style="width: 60%;margin-left: 5rpx;font-size: 40rpx;" maxlength="12"/>

					</view>
				</view>
		</view>
		<view class=" " style="margin-left: 15rpx;">可提现金额：<text style="font-size: 16px;color: red;">{{money}}</text>,<text
				style="color: #0055ff;margin-left: 20rpx;">全部提现</text></view>
		<view class="align-center" style="margin-top: 150rpx;">
			<button class="align-center bg-yellow lg " @click="toTiXianMoney(openid,money)"
				style="width: 600rpx;color: azure;">确认</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				openid: '',
				money: ''
			}
		},
		onLoad(option) { //option为object类型，会序列化上个页面传递的参数
			console.log(option.openid); //打印出上个页面传递的参数。
			this.openid = option.openid;
		},
		methods: {
		
			toTiXianMoney(openid,money) {
				console.log(this.userInput)
				console.log(openid);
				this.$axios({
					method: 'post',
					url: '/subMoney/' + this.openid,
					params: {money:money}

				}).then(res => {
					this.openid = res.data;

				}).catch(err => {
					console.log(err)
				})
				setTimeout(function() {
					uni.showToast({
						title: "提现成功!"
					});
					setTimeout(function () {
					     //要延时执行的代码
						uni.reLaunch({
							url:'/pages/my/my'
						})
					    }, 1000) //延迟时间 这里是1秒
				}, 1000)
			}
		}
	}
</script>

<style>

</style>
